 
#include<iostream>
#include<cstdio>
using namespace std;
#define MAX 500500

int n, p[MAX], a[MAX];
int t[MAX];

int lb(int x) {
    return x & (-x);
}

void add(int x, int v) {
    while (x <= n) {
        t[x] += v;
        x += lb(x);
    }
}

int sum(int x) {
    int ret = 0;
    while (x) {
        ret += t[x];
        x -= lb(x);
    }
    return ret;
}

int main() {
    scanf("%d", &n);
    for (int i = 1; i <= n; ++i)
        scanf("%d", &p[i]);
        
    for (int i = 1; i <= n; ++i)
        add(i, 1);
        
    for (int i = n; i >= 1; --i) {
        int l = 1, r = n, ans1 = 0, ans2 = 0, ans = 0;
        while (l <= r) {
            int mid = (l + r) >> 1;
            if (sum(mid) <= p[i]) {
                ans1 = mid;
                l = mid + 1;
            } else {
                r = mid - 1;
            }
        }
        
        l = 1, r = n;
        while (l <= r) {
            int mid = (l + r) >> 1;
            if (sum(mid) < p[i]) {
                l = mid + 1;
            } else {
                r = mid - 1;
                ans2 = mid;
            }
        }
        
        if (!a[ans1])
            ans = ans1;
        else
            ans = ans2;
            
        a[ans] = i;
        add(ans, -1);
    }
    
    for (int i = 1; i <= n; ++i)
        printf("%d ", a[i]);
    puts("");
    
    return 0;
}
 